#!/usr/bin/env python
"""
    Django's command-line utility for administrative tasks.
    Django用于管理任务的命令行实用程序。
"""
import os
import sys


def main():
    """Run administrative tasks. 运行管理任务。"""
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoProject.settings')
    # 设置默认的Django设置模块
    try:
        from django.core.management import execute_from_command_line
        # 从Django核心管理模块导入execute_from_command_line函数
    except ImportError as exc:
        # 捕获导入错误
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)
    # 执行命令行


if __name__ == '__main__':
    main()
    # 如果脚本作为主程序运行，则调用main函数

# 以上代码自始至终都不需要动，（除非你更改了Django的安装位置。）